package com.itheima.afternoon;

import java.lang.reflect.Constructor;

public class demo02 {
    public static void main(String[] args) throws ClassNotFoundException, NoSuchMethodException {
        Class clazz = Class.forName("com.itheima.afternoon.Student");
        Constructor[] constructors1 = clazz.getConstructors();
        for (Constructor constructor : constructors1) {
            System.out.println(constructor);
        }
        System.out.println("---------------------------------------------------------------");
        Constructor[] constructors2 = clazz.getDeclaredConstructors();
        for (Constructor constructor : constructors2) {
            System.out.println(constructor);
        }
        System.out.println("---------------------------------------------------------------");
        Constructor constructor1 = clazz.getConstructor(String.class,String.class);
        System.out.println(constructor1);
        System.out.println("---------------------------------------------------------------");
        Constructor declaredConstructor = clazz.getConstructor(String.class, String.class, int.class);
        System.out.println(declaredConstructor);
        System.out.println("---------------------------------------------------------------");
        Constructor declaredConstructor1 = clazz.getDeclaredConstructor(String.class);
        System.out.println(declaredConstructor1);
    }
}
